package cn.victory._01_redisURI;

import io.lettuce.core.RedisURI;
import org.junit.Test;

import java.time.Duration;


/**
 * @ Description TODO
 * @ Author victory
 * @ Date 2022/6/29
 **/
public class RedisURIDemo {

    @Test
    public void testRedisURI(){
        //方式一
        //redis://[password@]host[:port][/databaseNumber]明文 Redis 连接
        //
        //rediss://[password@]host[:port][/databaseNumber] SSL 连接Redis 连接
        //
        //redis-sentinel://[password@]host[:port][,host2[:port2]][/databaseNumber]#sentinelMasterId 用于使用 Redis Sentinel
        //
        //redis-socket:///path/to/socket Unix 域套接字连接到 Redis
        RedisURI redisURI1 = RedisURI.create("redis://localhost/");
        //方式二
        RedisURI redisURI2 = RedisURI.builder().withHost("localhost").withPort(6379).build();
        //方式三
        RedisURI redisURI3 = new RedisURI("localhost", 6379, Duration.ofSeconds(600));
    }




}
